﻿using Learun.Util;
using SqlSugar;
using System;
using System.Collections.Generic;
namespace Learun.Application.TwoDevelopment.ZZDT_EC
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-02-24 11:10
    /// 描 述：对象类型
    /// </summary>
    [SugarTable("ec_objecttype")]
    public class ec_objecttypeEntity
    {
        #region 实体成员
        /// <summary>
        /// 对象类型ID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string ObjectTypeID { get; set; }
        /// <summary>
        /// 上级对象类型ID。<see cref="ObjectTypeID"/>"/>
        /// </summary>
        /// <returns></returns>
        public string UpObjectTypeID { get; set; } = "";
        /// <summary>
        /// 默认的布置图的图例
        /// </summary>
        /// <returns></returns>
        public string DefaultLayoutLibFileID { get; set; } = "";
        /// <summary>
        /// 默认为0。1代表属于Panel类，要处理ec_panel
        /// </summary>
        public int? SystemPanel { get; set; } = 0;
        /// <summary>
        /// 对象类型名称
        /// </summary>
        /// <returns></returns>
        public string ObjectTypeName { get; set; } = "";
        /// <summary>
        /// 对象类型名称(英文)
        /// </summary>
        /// <returns></returns>
        public string ObjectTypeNameEN { get; set; } = "";
        /// <summary>
        /// 是否生成流水号
        /// </summary>
        /// <returns></returns>
        public int? IsSerialNumber { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        /// <returns></returns>
        public int? OrderID { get; set; }
        /// <summary>
        /// 完整路径
        /// </summary>
        /// <returns></returns>
        public string FullPath { get; set; } = "";
        /// <summary>
        /// 完整路径(中文)
        /// </summary>
        /// <returns></returns>
        public string FullPathCN { get; set; } = "";
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.SystemPanel = 0;
            this.ObjectTypeID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;
        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.ObjectTypeID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段
        /// <summary> 
        /// 是不是父级  1是  0不是 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string IsParent { get; set; }

        /// <summary> 
        /// 新的按句柄查询位号信息 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public List<ec_objecttypepEntity> props { get; set; }

        /// <summary> 
        /// 新的按句柄查询位号信息 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public List<ec_enginedataEntity> tags { get; set; }

        /// <summary> 
        /// 位号列表（下拉菜单要用）
        /// 新的按句柄查询位号信息 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public Dictionary<string, string> tagsListDropDown { get; set; }

        /// <summary> 
        /// 位号列表（下拉菜单要用）
        /// 新的按句柄查询位号信息 
        /// </summary> 
        /// <returns></returns> 
        [SugarColumn(IsIgnore = true)]
        public string TagAutoBySerialNumber { get; set; }
        #endregion
    }
}

